package com.bzframework.project.api.model.request;

import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.NotEmpty;
import java.util.List;

/**
 * @Author bingzhong
 * @Date 2025/3/5 10:56
 * @Description
 */
@Getter
@Setter
public class ApiInvokeRequest {

    @URL
    @NotEmpty
    private String url;

    @NotEmpty
    private String method;

    private List<NameValueField> requestHeader;

    private List<NameValueField> requestParam;

    private RequestBodyOption requestBodyOption;

    /**
     * 10s
     */
    private Integer timeout = 10;

    private Boolean headerIsOverride = false;

    @Data
    public static class NameValueField {

        private String key;

        private String name;

        private String value;

    }

}
